# @Version:1.0
# @Author：green-citrus

# tuple_a = (100, 200, 300, 400, 500)
# tuple_b = ('red', 'green', 'blue', 'yellow', 'white', 'black')
#
# # # print(tuple_a[2]) # 300
# #
# # index = 0
# # while index < len(tuple_b):
# #     print(tuple_b[index])
# #     index += 1
# #
# # for e in tuple_b:
# #     print(e)

# tuple_a = (100, 200, 300, ["jack", "tom", "mary"], 500)
# # 修改
# tuple_a[3][0] = "zhangsan"
# print(tuple_a)
#
# # 删除
# del tuple_a[3][0]
# print(tuple_a)
#
# # 增加
# tuple_a[3].append("lisi")
# print(tuple_a)

# # tuple
# a = (1,)
#
# # int
# b = (2)

# tuple_a = (100, 200, 300, 100, 200)
# print(len(tuple_a)) # 一个有5个元素
# print(max(tuple_a)) # 最大值 400
# print(min(tuple_a)) # 最小值 100
#
# print(tuple_a.count(100)) # 100出现的次数2
# print(tuple_a.index(200)) # 200第一次出现的索引1
#
# print(100 in tuple_a) # True
# print(2 in tuple_a) # False

# 定义一个元组，('大话西游'，'周星驰'，80，，『'周星驰'，'小甜甜"1)，信息为(片名，导演，票价，演员列表)
a = ("大话西游", "周星驰", 80, ["周星驰", "小甜甜"])
# 1）查询票价对应索引
print(a.index(80))
# 2）遍历所有的演员
for e in a[3]:
    print(e)
# 3）删除'小甜甜'，增加演员'牛魔王'、‘猪八戒'
del a[3][1]
a[3].extend(["牛魔王", "猪八戒"])

print(a)
